package housing.task3.dto.PK;

import java.io.Serializable;

/**
 * This class represents the primary key of the HS_WorkType table.
 */
public class HsWorktypePk implements Serializable {
    protected int worktypeId;

    /**
     * This attribute represents whether the primitive attribute worktypeId is null.
     */
    protected boolean worktypeIdNull;

    /**
     * Sets the value of worktypeId
     */
    public void setWorktypeId(int worktypeId) {
        this.worktypeId = worktypeId;
    }

    /**
     * Gets the value of worktypeId
     */
    public int getWorktypeId() {
        return worktypeId;
    }

    /**
     * Method 'HsWorktypePk'
     */
    public HsWorktypePk() {
    }

    /**
     * Method 'HsWorktypePk'
     *
     * @param worktypeId
     */
    public HsWorktypePk(final int worktypeId) {
        this.worktypeId = worktypeId;
    }

    /**
     * Sets the value of worktypeIdNull
     */
    public void setWorktypeIdNull(boolean worktypeIdNull) {
        this.worktypeIdNull = worktypeIdNull;
    }

    /**
     * Gets the value of worktypeIdNull
     */
    public boolean isWorktypeIdNull() {
        return worktypeIdNull;
    }

    /**
     * Method 'equals'
     *
     * @param _other
     * @return boolean
     */
    public boolean equals(Object _other) {
        if (_other == null) {
            return false;
        }

        if (_other == this) {
            return true;
        }

        if (!(_other instanceof HsWorktypePk)) {
            return false;
        }

        final HsWorktypePk _cast = (HsWorktypePk) _other;
        if (worktypeId != _cast.worktypeId) {
            return false;
        }

        if (worktypeIdNull != _cast.worktypeIdNull) {
            return false;
        }

        return true;
    }

    /**
     * Method 'hashCode'
     *
     * @return int
     */
    public int hashCode() {
        int _hashCode = 0;
        _hashCode = 29 * _hashCode + worktypeId;
        _hashCode = 29 * _hashCode + (worktypeIdNull ? 1 : 0);
        return _hashCode;
    }

    /**
     * Method 'toString'
     *
     * @return String
     */
    public String toString() {
        StringBuffer ret = new StringBuffer();
        ret.append("housing.task3.dto.PK.HsWorktypePk: ");
        ret.append("worktypeId=" + worktypeId);
        return ret.toString();
    }

}
